﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;

namespace WebBarracoDoSom.Models
{
    public class Emprestimo
    {
        public int ID { get; set; }

        [Display(Name = "Usuário")]
        public int User_ID { get; set; }

        public int Intrum_ID { get; set; }

        [Display(Name = "Data de Retirada")]
        [Required(ErrorMessage = "Inserir uma Data")]
        [DataType(DataType.DateTime)]
        public DateTime DataRealizacao { get; set; }

        [Display(Name = "Data de Devolução")]
        [DataType(DataType.DateTime)]
        public DateTime DataDevolucao { get; set; }

        [Display(Name = "Valor")]
        public double Valor { get; set; }
    }

    public class EmprestimoDBContext : DbContext
    {
        public DbSet<Emprestimo> Emprestimos { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}